package com.jvm.classloader;

import java.util.Random;

/**
 * 当一个接口初始化的时候并不要求父接口都完成初始化
 * 只有在真正使用到父接口（如使用接口中定义的常量）的时候才会初始化
 */
public class MyTest5 {
    public static void main(String[] args) {
        //System.out.println(Child5.b);
        System.out.println(Parent_1.thread);
    }
}

class Grandpa{

    public static Thread thread = new Thread(){
        {
            System.out.println("Grandpa is invocked!");
        }
    };
}

class Parent5 extends Grandpa{

    public static Thread thread = new Thread(){
        {
            System.out.println("Parent5 is invocked!");
        }
    };
}

class Child5 extends Parent5{

    public static int b = 5;
}

interface Grandpa_1{

    public static Thread thread = new Thread(){
        {
            System.out.println("Grandpa_1 is invocked!");
        }
    };
}

interface Parent_1 extends Grandpa_1{

    public static Thread thread = new Thread(){
        {
            System.out.println("Parent_1 is invocked!");
        }
    };
}